package easyexcel.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@NoArgsConstructor
@AllArgsConstructor
@Data
@Builder
public class User {
    @ExcelProperty(value = "用户编号")
    private Integer userId;

    @ExcelProperty(value = "姓名")
    private String userName;

    @ExcelProperty(value = "性别")
    private String gender;

    @ExcelProperty(value = "工资")
    private Double salary;

    @ExcelProperty(value = "入职时间")
    @ColumnWidth(value = 20) // 列宽, 可以作用在类或字段上
    @DateTimeFormat("yyyy-MM-dd")
    private Date hireDate;
}
